package com.order_system.controller;


import com.order_system.constants.Code;
import com.order_system.entity.Product;
import com.order_system.entity.ResModel;
import com.order_system.service.ProductService;
import com.order_system.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李阳
 * @since 2023-01-06
 */
@RestController
@RequestMapping("/api/product/type")
public class ProductTypeController {

    @Autowired
    private ProductTypeService productTypeService;

    /**
     * 查询商品类型
     * @return
     */
    @GetMapping("/list")
    public ResModel list(){
        return ResModel.success(Code.SUCCESS,productTypeService.list());
    }

}

